<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/dispatch.css">
    <script src="__PUBLIC__/dispatch.js"></script>
	<script type="text/javascript">
	window.onload=function(){
		altRows('alternatecolor');
	}
	</script>
<style>
td.sum{
	padding:5px 10px;
	font-family: '微软雅黑';
	font-weight: bold;
}
.small-important{
	display: none;
}
@media screen and (max-width: 500px) {
	.no-important-col{
		display: none;
	}
	.small-important{
		display: block;
	}
}
</style>
</head>
<body>
<h4>链接详情</h4>
<a href="./link">到链接列表</a>
<a href="./tag">到标签列表</a>
<a href="javascript:confirm('确定注销？')?location.href='./logout':false;" >注销</a>

<h5>基本信息</h5>
<p>名称：<?php echo $link['name']; ?></p>
<p style="word-wrap:break-word;word-break:break-all">链接：<a href="<?php echo $link['link']; ?>"><?php echo $link['link']; ?></a></p>
<p>是否默认：<?php echo $link['is_default']?'是':'否'; ?></p>
<p>未知次数：<?php echo $link['unknown_count']; ?></p>
<h5>标签详情</h5>

<div>
	<table width="100%" id="alternatecolor" border="0" cellpadding="3" cellspacing="0" >
		<tr>
			<th>序号</th>
			<th>编号</th>
			<th>次数</th>
			<th>链接</th>
			<th class="no-important-col">操作</th>
		</tr>
		<?php $index = 0;$count=$link['unknown_count']; ?>
		<?php foreach($link_entries as $entry):?>
			<tr>
				<td class="no"><?php echo ++$index; ?></td>
				<td class="no"><?php echo sprintf('%05d',$entry['id']); ?></td>
				<td class="no">
					<?php echo $entry['count']>0?$entry['count']:''; ?>
				</td>
				<td>
					<?php echo 'http://'.$_SERVER['HTTP_HOST'].'__ROOT__/?i='.sprintf('%05d',$entry['id']); ?>
					<span class="small-important">
						<a href="<?php echo 'http://'.$_SERVER['HTTP_HOST'].'__ROOT__/?i='.sprintf('%05d',$entry['id']); ?>" target="_blank">前往&gt;&gt;</a>
					</span>
				</td>
				<td class="no-important-col">
					<a href="<?php echo 'http://'.$_SERVER['HTTP_HOST'].'__ROOT__/?i='.sprintf('%05d',$entry['id']); ?>" target="_blank">前往&gt;&gt;</a>
				</td>
			</tr>
			<?php $count += $entry['count']; ?>
			<?php endforeach ?>
		<tr>
			<td class="no sum" colspan="5">总次数(含未知)：<?php echo $count;?></td>
		</tr>
	</table>
</div>


</body>
</html>